import java.io.*;
import java.net.*;
import java.sql.*;
import java.util.HashMap;
import java.util.Map;


public class MyServer {
	public static Map<String,Socket> mp=new HashMap<String,Socket>(); 
	
	
	public static void main(String args[]){
		
		try{
		String dburl = "jdbc:mysql://localhost:3306/Androidgame";
		String user = "root";
		String password ="123456";
		String driver = "com.mysql.jdbc.Driver";
		Class.forName(driver);
		Connection conn  = DriverManager.getConnection(dburl,user,password);
		String sql = "insert into player (pname,password,photo,gold) values(?,?,?,?);";
		PreparedStatement	ps = conn.prepareStatement(sql);
			ps.setString(1,"10");
			ps.setString(2, "1");
			ps.setInt(3, Integer.parseInt("1"));
			ps.setInt(4,Integer.parseInt("1"));
			ps.executeUpdate();
		}catch(Exception e){
			System.out.println(e.getMessage());
		}
//		ServerSocket server = new ServerSocket(10007);
//		while(true){
//			Socket client=server.accept();
//			BufferedReader buf=new BufferedReader(new InputStreamReader(client.getInputStream()));
//			String str = null;
////			while(str==null)
//				str = buf.readLine();
//			System.out.println(str);
//			MyThread thread = new MyThread(client,str);
//			mp.put(str, client);
//			thread.start();
//		}
	}
}
